import scrapy
from ..items import XpathItem

class AppSpider(scrapy.Spider):
    name = "app"
    allowed_domains = ["product.cheshi.com"]
    start_urls = ["https://product.cheshi.com/rank/2-0-0-0-1/"]


    def parse(self, response):
        print(response.request.headers['User-Agent'])
        # cars = response.xpath("//ul[@class='condition_list_con']/li")
        # item = XpathItem()
        # for car in cars:
        #     item['title'] = car.xpath("./div[@class='m_detail']//a/text()").get()
        #     item['price'] = car.xpath("./div[@class='m_detail']//b/text()").get()
        #     # 同步操作
        #     yield item
